package com.ruoyi.web.controller.system;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.SysOssDetail;
import com.ruoyi.system.service.ISysOssDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 文件记录Controller
 *
 * @author fengcheng
 * @date 2025-01-16
 */
@RestController
@RequestMapping("/system/ossDetail")
public class SysOssDetailController extends BaseController {
    @Autowired
    private ISysOssDetailService sysOssDetailService;

    /**
     * 查询文件记录列表
     */
    @PreAuthorize("@ss.hasPermi('system:ossDetail:list')")
    @GetMapping("/list")
    public TableDataInfo list(SysOssDetail sysOssDetail) {
        startPage();
        List<SysOssDetail> list = sysOssDetailService.selectSysOssDetailList(sysOssDetail);
        return getDataTable(list);
    }

    /**
     * 删除文件记录
     */
    @PreAuthorize("@ss.hasPermi('system:ossDetail:remove')")
    @Log(title = "文件记录", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ossDetailIds}")
    public AjaxResult remove(@PathVariable Long[] ossDetailIds) {
        sysOssDetailService.deleteSysOssDetailByOssDetailIds(ossDetailIds);
        return success();
    }
}
